<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="/layout/template_box.xhtml"
                xmlns:a4j="http://richfaces.org/a4j">


  <ui:define name="head">
    <a4j:loadStyle src="/css/custom-theme/jquery-ui-1.8.2.custom.css"/>



  </ui:define>

  <ui:define name="MenuInterno">
    <ui:include src="/layout/menu_motivo.xhtml"/>
  </ui:define>


  <ui:define name="body">

    <h2 class="t_motivo">Motivos</h2>

    <div id="tamanho_div">


      <h:form styleClass="form_confea" ajaxSubmit="true">
    	<fieldset>
			<h:messages globalOnly="true" styleClass="tool_alerta" />
	</fieldset>
        <fieldset>
          <s:div rendered="#{listaMotivos.size == 0}">
            <p class="tool_alerta"> Nenhum Motivo cadastrado.</p>
          </s:div>

          <rich:dataTable value="#{listaMotivos}" var="_motivo" styleClass="grid_dados" cellpadding="0" cellspacing="0"
          border="0"  id="motivoEvasaoLista" rows="#{motivoEvasaoList.paginacao}"
          rowClasses="grid_zebra,none">
        
            <rich:column >
              <f:facet name="header">Nome</f:facet>
              <h:outputText value="#{_motivo.nome}"/>
            </rich:column>


            <rich:column style="width:12%">
              <f:facet name="header">Ações</f:facet>
                <span>
                    <s:link title="Editar Motivo"                 
                    id="btnEditar" styleClass="editar2" view="/motivo_evasao/motivo.xhtml" propagation="none">
	                   <f:param name="idMotivo" value="#{_motivo.id}"/>
                    </s:link>

		     	  		<h:commandLink title="Excluir" id="btnExcluir" rendered="#{s:hasRole('Gestor')}" immediate="true"
	                 	 	action="#{motivoEvasaoList.apagar}"
	                    	styleClass="excluir2" 
	                    	onclick="return confirm('Confirmar exclusão?')">
	                    </h:commandLink>

   	  			
   	  			</span>
            </rich:column>

          </rich:dataTable>
          <rich:datascroller id="scrolInstituicao"
            for="motivoEvasaoLista" maxPages="#{motivoEvasaoList.paginacao}"
            align="center" renderIfSinglePage="false"  />

        </fieldset>
      </h:form>

    </div>
  </ui:define>

</ui:composition>
